package com.chixing.day04_oop;

public class AccountTest {
    public static void main(String[] args) {
        SavingAccount sa =  new SavingAccount();
        sa.setAccNo(62228883333999L);
        sa.setAccName("smith");
        sa.setAccPassword("123456");
        sa.setAccTelNo(13771234522L);
        sa.setAccBalance(1000);
        sa.setAccType(0);

        System.out.println(sa);

        SavingAccount sa2 = new SavingAccount(62228883333999L,"katy","123456",13771234522L,200,0);


        SavingAccount sa3 = sa2;

        // 判断 sa3 是不是 SavingAccount  类型
       boolean result1 =  sa3 instanceof SavingAccount; // 看 堆中的对象值 的类型


        // 父类 类型  = new 子类对象()
        // 父类 引用子类对象
       Account acc =  new SavingAccount(62228883333999L,"katy","123456",13771234522L,200,0);

        System.out.println(acc instanceof SavingAccount);// true
        System.out.println(acc instanceof Account); //true

    }
}






